package com.coconet.gas.core.datascope;

//
//Source code recreated from a .class file by IntelliJ IDEA
//(powered by Fernflower decompiler)
//


import java.lang.reflect.Proxy;
import java.util.Properties;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import org.springframework.util.StringUtils;

public final class PluginUtils {
 public static final String DELEGATE_BOUNDSQL_SQL = "delegate.boundSql.sql";

 private PluginUtils() {
 }

 public static <T> T realTarget(Object target) {
     if (Proxy.isProxyClass(target.getClass())) {
         MetaObject metaObject = SystemMetaObject.forObject(target);
         return realTarget(metaObject.getValue("h.target"));
     } else {
         return (T) target;
     }
 }

 public static String getProperty(Properties properties, String key) {
     String value = properties.getProperty(key);
     return StringUtils.isEmpty(value) ? null : value;
 }
}
